//
// Created by xiexiangping on 23-04-12
//
#ifndef FRAMEOPERATE_H
#define FRAMEOPERATE_H

#include <iostream>
#include <string>
#include <cstring>
#include <thread>
#include <opencv2/opencv.hpp>
#include <dshow.h>

extern "C" {
    #include <libavdevice/avdevice.h>
    #include <libavformat/avformat.h>
    #include <libavcodec/avcodec.h>
    #include <libswscale/swscale.h>
    #include <libswresample/swresample.h>
    #include <libavutil/avassert.h>
    #include <libavutil/mem.h>
    #include <libavutil/imgutils.h>
    #include <libavutil/time.h>
    #include <libavutil/error.h>
    #include <libavutil/log.h>
    #include <libavutil/audio_fifo.h>
    #include <libavfilter/avfilter.h>
    #include <libavfilter/buffersink.h>
    #include <libavfilter/buffersrc.h>
    #include <libavutil/imgutils.h>
}

#define DEBUG_VIDEO 1

class frameOperate {
public:
    frameOperate() {}

    ~frameOperate() {}

    static cv::Mat avframe_to_cvmat_yuyv(AVFrame* frame);

    static cv::Mat avframe_to_cvmat_yuvp20(AVFrame *frame);
};

#endif // FRAMEOPERATE_H
